<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:77:"E:\phpstudy2016\WWW\shopsum\public/../application/admin\view\count\loock.html";i:1520915472;s:57:"E:\phpstudy2016\WWW\shopsum\application\public\admin.html";i:1520912952;}*/ ?>
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>数据字典-<?php echo \think\Config::get('title'); ?></title>
    <link rel="stylesheet" href="../../../../public/static/public/boo3/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.css">
    <link rel="stylesheet" href="__PUBLIC__/index/css/sytle.css">
    <script src="__PUBLIC__/public/js/jquery-2.1.4.min.js"></script>
    <script src="__PUBLIC__/public/js/vue.min.js"></script>
    <script src="__PUBLIC__/public/js/jquery.transit.js"></script>
    <script src="__PUBLIC__/public/js/jquery.timers-1.2.js"></script>
    <script src="__PUBLIC__/public/layer-v3.1.1/layer/layer.js"></script>
    <style>
        #container{
            padding: 0 30px;
        }
        nav{
            background-color: #f5f5f5;
            padding: 10px 20px;
            z-index: 99;
            margin-bottom: 15px;
        }
        @media screen and (max-width: 800px) {
            nav{
                display: none;
            }
        }
    </style>
    <script>
        var DINDEX = '/admin/index';
        var DUSER = '/admin/user';
        var DADMIN = '/admin';
        var DJOURNALISM = '/admin/journalism';
        var DCOUNT = '/admin/count';
        //页面
        function yeMian(url,fn = 1,this_json = {title:'信息',area:['400px','450px']}) {

            var index = layer.open($.extend({type:2,content:url,end:function () {
                    if(typeof fn != 'number' ){
                        fn();
                    }
                }},this_json));
        }

        //看图
        function loock_img(url) {
            url = url.data('img');
            if((typeof url) != 'string'){
                layer.msg('没有数据查看',{icon:2});
                return;
            }
            layer.open({
                type:2,
                title:false,
                closeBtn:false,
                area:['100%','100%'],
                content:"<?php echo url('loock/index',['on'=>'true']); ?>?url="+url
            })
        }
    </script>
    
<link rel="stylesheet" href="__PUBLIC__/admin/css/index.dictionaries.css">


</head>
<body>

<nav>
       <small><i class="fa fa-institution"></i></small> 首页 > <?php echo \think\Config::get('this_user_name'); if(\think\Request::instance()->param('on') == 'true'): ?>
       <a href="javascript:;" onclick="parent.layer.close(parent.layer.getFrameIndex(window.name));"  title="关闭当前页面" class="btn btn-xs btn-default fa-pull-right " style="margin-left: 10px"><i class="fa fa-close"></i></a>
        <?php endif; ?>
    <a href="javascript:location.reload();" title="刷新" class="btn btn-xs btn-success fa-pull-right"><i class="fa fa-refresh"></i></a>
</nav>

<div id="container">
    <div class="clearfix"></div>
    <div style="height: 20px;"></div>
    <div class="table-responsive" id="header">
        <table class="table table-bordered table-hover" v-cloak>
            <thead>
            <tr class="active">
                <th colspan="13">
                    <span class="fa-pull-right">总 <strong>{{list.length}}</strong> 条</span>
                </th>
            </tr>
            <tr class="active">
                <th><?php echo lang('序号'); ?></th>
                <th>支付</th>
                <th><?php echo lang('图片'); ?></th>
                <th><?php echo lang('时间'); ?></th>
                <th><?php echo lang('操作'); ?></th>
            </tr>
            </thead>
            <tbody>
            <template v-for="(key,index) in list">
                <tr>
                    <td>{{index+1}}</td>
                    <td>{{key.money}}</td>
                    <td><a href="javascript:;" onclick="loock_img($(this))" :data-img="key.img"><?php echo lang('查看'); ?></a></td>
                    <td>{{key.time}}</td>
                    <td>
                        <a href="javascript:;" title="删除" @click="del(index)"><i class="fa fa-trash-o"></i></a>
                    </td>
                </tr>
            </template>
            </tbody>
        </table>
    </div>
    <div id="Pagination"></div>

</div>


</body>
</html>



<script>
    var app = new Vue({
        el: '#container',
        data: {
            list: []
        }
    });
    app.del = (i)=>{
        layer.confirm("<?php echo lang('是否确定'); ?>",function () {
            $.post("<?php echo url('del_money'); ?>",{id:app.list[i].id},function (da) {
                if(da == 1){
                    layer.msg("<?php echo lang('成功'); ?>",{icon:1,offset:'rb'})
                }else{
                    layer.msg("<?php echo lang('失败'); ?>",{icon:2,offset:'rb'})
                }
                get_data();
            })
        })
    }
    get_data();

    //获取数据
    function get_data() {
        var index = layer.load(1);
        $.get("<?php echo url('count/loock',['id'=>\think\Request::instance()->param('id')]); ?>", function (da) {
            app.list = da;
            layer.close(index);
        });
    }

    //查看图片
    app.imgLock = (url)=>{
        layer.open({
            type:2,
            title:'查看文件',
            shift:'3',
            area:['100%','100%'],
            content:url
        })
    }





    //添加内容
    app.addData = () => {
        layer.open({
            type:2,
            area:['500px','400px'],
            content:"<?php echo url('count/addd',['id'=>\think\Request::instance()->param('id')]); ?>"
        })
    }
</script>
